package main

import (
	"fmt"
	"github.com/alecthomas/kingpin/v2"
	"net/http"
)

func main() {
	teststring := kingpin.Flag("hello", "test").Default("qq").String()
	kingpin.Parse()
	http.HandleFunc("/", func(writer http.ResponseWriter, request *http.Request) {
		writer.Write([]byte(`<html>
			<head><title>Node Exporter</title></head>
			<body>
			<h1>xxx Exporter</h1>
			<p><a href=" ` + *teststring + ` ">Metrics</a></p>
			</body>
			</html>`))
	})
	if err := http.ListenAndServe(":10051", nil); err != nil {
		fmt.Printf("Error occur when start server %v", err)
	}
}
